﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Dart : MonoBehaviour, IReflector
{
    [System.NonSerialized]
    public Vector3 moveDir;
    private float time = 0;
    private float moveSpeed = 5;

    public void SetTransform(Vector3 v)
    {
        transform.position = v;
    }

    // Update is called once per frame
    void Update()
    {
        time = time + Time.deltaTime;
        if (time > 15)
            Destroy(gameObject);
        transform.position += moveDir.normalized * moveSpeed * Time.deltaTime;
    }

    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.layer == 10)
        {

        }
    }

    public Vector3 GetDir()
    {
        return moveDir;
    }

    public void SetDir(Vector3 rV)
    {
        moveDir = rV;
    }
}